package com.bwie.controller;

import com.bwie.domain.User;
import com.bwie.service.Impl.UserServiceImpl;
import com.bwie.service.UserService;
import com.bwie.utils.R;
import com.bwie.vo.LoginUser;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import org.springframework.beans.factory.annotation.Autowired;

/**
 * (t_user)表控制层
 *
 * @author xxxxx
 */
@RestController
@RequestMapping("/user/t_user")
@Api(tags = {"用户管理"})
public class UserController {
    /**
     * 服务对象
     */
    @Autowired
    private UserService userService;

    @PostMapping("checkPhone")
    @ApiOperation("检查手机号是否存在")
    public R CheckPhone(@RequestBody LoginUser loginUser) {
        return userService.checkPhone(loginUser);
    }

    @PostMapping("sendPhoneCode")
    @ApiOperation("发送手机验证码")
    public R sendPhoneCode(@RequestBody LoginUser loginUser) {
        return userService.sendPhoneCode(loginUser);
    }

    @PostMapping("LoginByPhone")
    @ApiOperation("手机验证码登录")
    public R LoginByPhone(@RequestBody LoginUser loginUser) {
        return userService.LoginByPhone(loginUser);
    }
}
